package sk.octopuss.archery.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import sk.octopuss.archery.domain.Brand;
import sk.octopuss.archery.service.BrandService;


@RequestMapping("/brands")
@Controller
public class BrandController extends AbstractController {
	@Autowired
	private BrandService brandService;
	
	
	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public String show(@PathVariable("id") final Long id, final Model uiModel) {
		final Brand b = brandService.find(id);
		 uiModel.addAttribute(b);
        return "brands/show";
    }

}
